<?php
/**
 * Created by PhpStorm.
 * User: Dean.Wu
 * Date: 2018/2/24 0024
 * Time: 15:18
 */
namespace App\Http\Controllers\Admin;

use App\Models\TagPost;
use App\Models\Tags;
use App\Models\Types;

class TagsController extends Controller{

    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     * @author Deann.wu
     * @name 标签页面
     */
    public function index(){
        //顶级分类
        $lists=Tags::getListData();
        foreach ($lists as $list){
            $list->count=TagPost::getCountByTagId($list->id);
        }
        return view('admin.tag.index',compact("lists"));
    }
}